<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box">
        {{price | fmPrice}}

        <ul>
            <li v-for="(item,index) in prolist">
                {{item.name}} - {{item.price | discount(0.5) | fmPrice}}
            </li>
        </ul>
    </div>
    <script src="js/vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#box",
            data:{
                price:1000,
                prolist:[
                    {name:"电视机1",price:3000},
                    {name:"电视机2",price:4000},
                    {name:"电视机3",price:5000},
                ]
            },
            filters:{
                fmPrice(val){
                    console.log(val);
                    return '￥'+val
                },
                discount(val,num){
                    return val * num;
                }
            }
        })
    </script>
</body>
</html>